//请求方式
export enum RequestEnum {
    GET = 'GET',
    POST = 'POST',
    PUT = 'PUT',
    DELETE = 'DELETE',
    PATCH = 'PATCH',
}

//相应状态码
export enum ResultEnum {
    DATA_SUCCESS = 0,
    SUCCESS = 200,
    SERVER_ERROR = 500,
    SERVER_FORBIDDEN = 403,
    NOT_FOUND = 404,
    TIMEOUT = 60000
}

//常用的请求头
export enum ContentTypeEnum {
    JSON = 'application/json;charset=UTF-8',
    FORM = 'application/x-www-form-urlencoded;charset=UTF-8',
    FORM_DATA = 'multipart/form-data;charset=UTF-8',
    TEXT = 'text/plain;charset=UTF-8',
}

//页面路由
export enum PageEnum {
    // 错误
    ERROR_PAGE_NAME_403 = 'ErrorPage403',
    ERROR_PAGE_NAME_404 = 'ErrorPage404',
    ERROR_PAGE_NAME_500 = 'ErrorPage500'
}

//请求错误重定向页面
export const RedirectPageEnum = new Map([
    [ResultEnum.SERVER_ERROR, PageEnum.ERROR_PAGE_NAME_500],
    [ResultEnum.SERVER_FORBIDDEN, PageEnum.ERROR_PAGE_NAME_403],
    [ResultEnum.NOT_FOUND, PageEnum.ERROR_PAGE_NAME_404]
])